#include "person.h"


Person::Person(QString name, QObject *parent) : QObject(parent) {
    m_name = name;
}

int Person::getAge(){
    return m_age;
}

void Person::setAge(int age){
    m_age = age;
    emit ageChanged(age);   //发射设置年龄信号
}

void Person::incAge(){
    m_age++;
    emit ageChanged(m_age); //发射年龄增长信号
}


